<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="../logo.png">
    <title>如何初始化？ | 测试</title>
    <script src="../node_modules/clunch/dist/clunch.js"></script>
    <script src="../dist/plain-chart.js"></script>
    <style>
        #canvas {
            width: 400px;
            height: 300px;
        }
    </style>
</head>

<body>

    <div id='canvas'></div>

    <script>

        // 跨端方法
        // PlainChart(function (options, serieslist) {
        //     return new Promise(resolve => {

        //         // 注册组件
        //         Clunch.series(serieslist);

        //         // 创建对象
        //         options.el = document.getElementById('canvas');
        //         let clunch = new Clunch(options);

        //         // 标记已解决
        //         resolve(clunch);

        //     });
        // }).then(myChart => {

        //     console.log(myChart);

        // });

        // H5独有
        var myChart = PlainChart.init(Clunch, document.getElementById('canvas'));
        console.log(myChart);


    </script>

</body>

</html>
